<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/manage/header.jsp"%>
<div>
	<table border="1" width="738">
		<tr>
			<th>借书人</th>
			<th>借书时间</th>
			<th>借书数量</th>
			<th>借书类型</th>
			<th>操作</th>
		</tr>
		<c:forEach items="${page.records}" var="o" varStatus="vs">
			<tr class="odd">
				<td>${o.customer.username }</td>
				<td>${o.gentime }</td>
				<td>${o.quantity }</td>
				<td><c:choose>
						<c:when test="${o.status==0}"> 
	   						【借书,待处理..】
	   					</c:when>
						<c:when test="${o.status==1}">
	   						【已还】
	   					</c:when>
						<c:when test="${o.status==2}">
	   						【学生借书中..】
	   					</c:when>
	   					<c:when test="${o.status==3}">
	   						【已经拒绝】
	   					</c:when>
	   					<c:when test="${o.status==4}">
	   						【还书,待处理...】
	   					</c:when>
					</c:choose></td>
				<td><c:choose>
						<c:when test="${o.status==0}">
							<a href="javascript:agrOneItem('${o.num}')">同意</a>&nbsp;
	   					    <a href="javascript:disAgrOneItem('${o.num}')">不同意</a>&nbsp;
	   					    <a href="${pageContext.request.contextPath}/manage/ManageServlet?op=showDetails&ordernum=${o.num}">查看明细</a>
	   					    
						</c:when>
						<c:when test="${o.status==1}">
	   						不需要处理&nbsp;&nbsp;
	   						<a href="${pageContext.request.contextPath}/manage/ManageServlet?op=showDetails&ordernum=${o.num}">查看明细</a>
	   					</c:when>
						<c:when test="${o.status==2}">
							不需要处理&nbsp;&nbsp;
	   					    <a href="${pageContext.request.contextPath}/manage/ManageServlet?op=showDetails&ordernum=${o.num}">查看明细</a>
	   					    
						</c:when>
						<c:when test="${o.status==3}">
	   						不需要处理&nbsp;&nbsp;
	   						<a href="${pageContext.request.contextPath}/manage/ManageServlet?op=showDetails&ordernum=${o.num}">查看明细</a>
	   						
	   					</c:when>
	   					<c:when test="${o.status==4}">
	   						<a href="javascript:agrBackBookOneItem('${o.num}')">同意</a>&nbsp;
	   					    <a href="javascript:disAgrBackBookOneItem('${o.num}')">不同意</a>&nbsp;
	   					    <a href="${pageContext.request.contextPath}/manage/ManageServlet?op=showDetails&ordernum=${o.num}">查看明细</a>
	   					</c:when>
					</c:choose></td>
			</tr>
		</c:forEach>
	</table>
	<%@include file="/commons/page.jsp"%>
</div>
<script type="text/javascript">
	function agrOneItem(num) {
		var sure = window.confirm("同意？");
		if (sure) {
			window.location.href = "${pageContext.request.contextPath}/manage/ManageServlet?op=agrOrder&num="
					+ num;
		}
	}
	function disAgrOneItem(num) {
		var sure = window.confirm("不同意？");
		if (sure) {
			window.location.href = "${pageContext.request.contextPath}/manage/ManageServlet?op=dsAgrOrder&num="
					+ num;
		}
	}
	function agrBackBookOneItem(num) {
		var sure = window.confirm("同意？");
		if (sure) {
			window.location.href = "${pageContext.request.contextPath}/manage/ManageServlet?op=agrBackBook&num="
					+ num;
		}
	}
	function disAgrBackBookOneItem(num) {
		var sure = window.confirm("不同意？");
		if (sure) {
			window.location.href = "${pageContext.request.contextPath}/manage/ManageServlet?op=disAgrBackBook&num="
					+ num;
		}
	}
</script>

</body>
</html>
